#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
// 调试监控用数据
#define MAX_CANCYCLICMONITOR_CNT 60

typedef struct
{
    uint64_t cur_time;
    uint64_t cur_cyclic_us;
    uint64_t min_cyclic_us;
    uint64_t max_cyclic_us;
    uint64_t timer_cur[MAX_CANCYCLICMONITOR_CNT];
    uint64_t timer_when_max_cyclic[MAX_CANCYCLICMONITOR_CNT];
    uint64_t timer_when_min_cyclic[MAX_CANCYCLICMONITOR_CNT];
    uint64_t timer_max_Control;
    uint64_t timer_max_GetCmdPos;
    uint64_t timer_max_Cmd;
    uint64_t timer_max_Can;
    uint64_t timer_max_SafeAction;
} CanCyclicMonitor;
extern void canmonitor_clear();
extern void canmonitor_record_timer(uint8_t chn_id);
extern int canmonitor_statistic();
extern void canmonitor_print();
#ifdef __cplusplus
}
#endif